package com.slz3.business.module.configManagement.conFeedback.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.configManagement.conFeedback.domain.ConFeedback;
import com.slz3.business.module.configManagement.conFeedback.domain.ConFeedbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class ConFeedbackTransactionalServiceImpl implements ConFeedbackTransactionalService {

    @Override
    public ConFeedback modify(ConFeedback conFeedbackNew) {
        Repositorys.conFeedback.test();
        Repositorys.conFeedback.save(ConFeedbackFactory.initBaseFields());
        System.err.println(1/0);
        conFeedbackNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.conFeedback.saveAndFlush(conFeedbackNew);
    }

    @Override
    public List<ConFeedback> batchModify(List<ConFeedback> conFeedbackList) {
        return Repositorys.conFeedback.saveAll(conFeedbackList);
    }
}
